<%@page import="beans.DetallePrograma"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title></title>
<%
	List<DetallePrograma> lista = (List<DetallePrograma>)request.getAttribute("ListaDetalle");


%>

<script type="text/javascript">
function cambiafrec(){
	var seleccion = document.getElementById('cbofrec');
	var val = seleccion.options[seleccion.selectedIndex].value;
	if (val!='') {
		document.getElementById('frec').value = val;
	}
	
	
}


</script>
</head>
<body>
	
	<table>
	
		<tr>
			<td><label for="fecini">Fecha de Inicio</label> <input
				type="text" id="fecini" value="<%= lista.get(0).getFecini()==null?"":lista.get(0).getFecini()%>"/></td>
		</tr>
		<tr>
			<td><label for="fecfin">Fecha de Fin</label> <input type="text"
				id="fecfin" value="<%= lista.get(0).getFecfin()==null?"":lista.get(0).getFecfin()%>"/></td>
		</tr>
		<tr>
			<td><label for="horini">Hora de Inicio</label> <input id="horini" value="<%= lista.get(0).getHini()==null?"":lista.get(0).getHini()%>"/></td>
		</tr>
		<tr>
			<td><label for="horfin">Hora de Fin</label> <input 
				id="horfin" value="<%= lista.get(0).getHfin()==null?"":lista.get(0).getHfin()%>"/></td>
		</tr>
		<tr>
			<td><label for="codamb">Codigo de Ambiente</label> <input
				type="text" id="codamb" value="<%= lista.get(0).getAmbiente()==null?"":lista.get(0).getAmbiente()%>" disabled="disabled"/></td>
				<td>
				<button type="button" id="btncambiarambiente" onclick="cargarAmbientesBuscar();" >Cambiar Ambiente</button>
				
				</td>
		</tr>
		<tr>
			<td><label for="frec">Frecuencia</label><input type="text"
				id="frec" value="<%= lista.get(0).getFrecuencia()==null?"":lista.get(0).getFrecuencia()%>" disabled="disabled"/></td>
				<td>
					<select id="cbofrec">
						<option value="">--Cambiar--</option>
						<option value="LMV" >L-M-V</option>
						<option value="MJS" >M-J-S</option>
					</select>
				</td>
				<td>
				
				<button type="button" id="cf" onclick="cambiafrec();" >&nbsp;</button>
				</td>
		</tr>
		<tr height="70">
			<td valign="bottom" align="center" colspan="2"><button type="button" id="btngrabardetalle" onclick="grabarDetallePrograma();">Grabar Cambios</button> </td>
		</tr>
	</table>
<script type="text/javascript">
$("#fecini").datepicker({
	changeMonth : true,
	changeYear : true,
	minDate: "-0",
	dateFormat : 'yy-mm-dd'
});

$("#fecfin").datepicker({
	changeMonth : true,
	changeYear : true,
	minDate: "-0",
	dateFormat : 'yy-mm-dd'
});

$( "#horini" ).spinner({
	min:9,
	max:23
});
$( "#horfin" ).spinner({
	min:9,
	max:23
});

$("#btncambiarambiente").button({
	icons:{primary : "ui-icon-refresh"}
}).click(function(event){
	$("#dgBuscarAmbiente").dialog("open");
});

$("#btngrabardetalle").button({
	icons:{primary : "ui-icon-disk"}
}).click(function(event) {
	event.preventDefault();
});

$("#cf").button({
	icons:{primary : "ui-icon-circle-check"}
}).click(function(event) {
	event.preventDefault();
});

$("#cbofrec").selectmenu({
	width:200
});
</script>

</body>
</html>